




<template>
<!-- <el-container style="height: 100%;">
      <el-aside width="17%" style="background-color: rgb(43, 46, 51);color:white">
        <div class="logo">
          <p style="color:#2DAFCB">HAPPY</p>
          <p>MMALL</p>
        </div>
        <el-menu
          :default-openeds="['1']"
          background-color="#2B2E33"
          text-color="#B5B5B5"
          active-text-color="white"
          :router="true"
        >
          <el-menu-item index="/homeon">
            <i class="el-icon-s-data"></i>
            <span slot="title">首页</span>
          </el-menu-item>
          <el-submenu index="/shopmanage">
            <template slot="title">
              <i class="el-icon-s-fold"></i>商品
            </template>
            <el-menu-item index="/shopmanage">商品管理</el-menu-item>
            <el-menu-item index="/shopcategory">品类管理</el-menu-item>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-circle-check"></i>订单
            </template>
            <el-menu-item index="/order">订单管理</el-menu-item>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-user"></i>用户
            </template>
            <el-menu-item index="/userlist">用户列表</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="text-align: right; font-size: 12px; background:#eee;border-bottom:2px" >
          <el-dropdown  @command="handleCommand">
            <i class="el-icon-user-solid"></i>
            <span style="font-size:16px;color:#333">
              欢迎，admin
              <i class="el-icon-caret-bottom"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="a">退出登录</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
         
        </el-header>
        <router-view></router-view>
      </el-container>
    </el-container> -->
    <div class="zhj">
        <div class="div1">
            <div>
                <p>HAPPY</p>
                <p>MMALL</p>
            </div>
            <el-row class="tac">
                <el-col :span="24">
                    <!-- <h5>自定义颜色</h5> -->
                    <!-- @open="handleOpen" @close="handleClose" -->
                    <el-menu default-active="2" class="el-menu-vertical-demo" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
                        <el-submenu index="1">
                            <template slot="title">
                                <i class="el-icon-location"></i>
                                <!-- <span @click="commodity('/HomeRight')">首页</span> -->
                                <span @click="commodity('/HomeRight')">首页</span>
                            </template>
                        </el-submenu>
                        <el-submenu index="2">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span>商品</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="1-1" @click="commodity('/Commodity')">商品管理</el-menu-item>
                                <el-menu-item index="1-2" @click="commodity('/Category')">品类管理</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="3">
                            <template slot="title">
                                <i class="el-icon-document"></i>
                                <span>订单</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="1-1" @click="commodity('/Order')">订单管理</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="4">
                            <template slot="title">
                                <i class="el-icon-setting"></i>
                                <span>用户</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="1-1" @click="commodity('/UserList')">用户列表</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                    </el-menu>
                </el-col>
            </el-row>
        </div>
        <div class="div2">
            <!-- <el-dropdown class="div21"  @click.native="handleCommand"> -->
            <el-dropdown class="div21"  @command="handleCommand">
                <span style="font-size:16px;color:#333"> 
                    <i class="el-icon-user-solid"></i>
                    欢迎，admin
                    <i class="el-icon-caret-bottom"></i>
                </span>
                <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item command="a">退出登录</el-dropdown-item>
                </el-dropdown-menu>
            </el-dropdown>
            <router-view></router-view>
        </div>
    </div>
</template>
<script>
   export default {
        name:'Home',
        data() {
            return {
                
            };
        },
        methods:{
            commodity(str){
                this.$router.push(str)
            },
            handleCommand(command) {
                this.$router.push("/login");
            },
          
        },
        mounted(){

        },
   };
</script>
<style lang="scss" scoped>

@import "@/Scss/index.scss";

.zhj{
    @include SizeBack(100%, 100%,rgb(250, 244, 244));
    @include FlexSpace();
}
.zhj>div{
    height: 100%;
}
.div1{
    width: 17%;
    background:black;
    color: white;
}
.tac{
    // width: 200px;
}
.div2{
    flex: 1;
    background: #F3F3F3;
}
.div21{
    @include SizeBack(100%, 4rem,white);
}
.div21>span{
    float: right;
    line-height: 4rem;
    margin-right: 3rem;
}
</style>